package com.woniuxy.rabbitmq.mqcallback;


import org.springframework.amqp.rabbit.core.RabbitTemplate.ConfirmCallback;
import org.springframework.amqp.rabbit.support.CorrelationData;
import org.springframework.stereotype.Service;

/**
 * @Author: wanghao
 * @Date: 2019/9/11 15:16
 */
@Service
public class MsgSendConfirmCallBack implements ConfirmCallback {
    @Override
    public void confirm(CorrelationData correlationData, boolean b, String s) {
        System.out.println("MsgSendConfirmCallBack  , 回调id:" + correlationData);
        if (b) {
            System.out.println("消息消费成功");
        } else {
            System.out.println("消息消费失败:" + s+"\n重新发送");
        }
    }
}
